﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mojo;

namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            //create the context
            var context = Context.Configure<HelloWorldTemplate>();

            //Get object by contract:
            var greeter1 = context.Template.Greeter();
            greeter1.Greet();


            //Get default implementation for type:
            var greeter2 = context.GetObject<IGreeter>();
            greeter2.Greet();


            //get old school named object (same as all other DI frameworks)
            var greeter3 = context.GetObject<IGreeter>("My Named Greeter");
            greeter3.Greet();

            Console.ReadLine();
        }
    }
}
